<template>
    <div class="FlexStep">
        <div v-for="i of total" :key="`step-${i}`">
            <div :class="i < current ? 'finished' : (i === current ? 'current' : '')" class="step">{{ i }}</div>
            <div v-if="i < total" class="line"/>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        total: {
            type: Number,
            required: true
        },
        current: {
            type: Number,
            required: true
        }
    }
}
</script>

<style lang="scss" scoped>
.FlexStep {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 50px auto;
    .step {
        height: 50px;
        width: 50px;
        border-radius: 50px;
        border: 3px solid #507e64;
        text-align: center;
        line-height: 50px;
        color: #507e64;
        font-size: 1.3rem;
        font-weight: bold;
        float: left;
        margin: auto;
        transition: all 0.3s linear;
        position: relative;
        &.finished {
            background-color: #507e64;
            color: #efe7db;
        }
        &.current {
            font-size: 1.8rem;
        }
    }
    .line {
        width: 100px;
        height: 3px;
        border-radius: 2px;
        background-color: #507e64;
        float: left;
        margin: 23px 5px;
    }
}
</style>